package com.cy.oa.test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.cy.oa.entity.LeaveBean;
import com.cy.oa.mapper.LeaveMapper;
import com.cy.oa.service.LeaveService;
import com.cy.system.config.DataSourceContextHolder;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({ "classpath:applicationContext.xml" })
public class testLeave {

	@Resource
	LeaveService leaveService;
	@Resource
	LeaveMapper leaveMapper;

	@Test
	public void testApplyLeave() {
		LeaveBean leave = new LeaveBean();
		leave.setLeaveStart("2018-07-16 09:00:00");
		leave.setLeaveEnd("2018-07-16 18:00:00");
		leave.setLeaveDays(1);
		leave.setLeaveUserId(4);
		leave.setLeaveReason("测试数据");
		DataSourceContextHolder.setDbType("activitiDataSource");
		/*leaveService.applyLeave(leave);*/
		DataSourceContextHolder.clearDbType();
	}
}
